<template>
	<view>
		<view class="cu-card dynamic">
			<view v-for="(item,index) in msgData" :key="index" class="cu-item shadow"  @click="naviageToPage(item)">
				<view class="content flex-sub padding">
					<view class="box">
						<view class="text-black fl title">
							<text :class="icon.icons" :style="{background:icon.icolor}" class="iconfont text-white padding-xs margin-right-xs title_icon text-center"></text>
							<text class="title_con">{{item.operator}}</text>
						</view>
						<view class="text-gray text-sm flex justify-between fr margin-top-sm" style="display: inline-block;">{{$utils.dateDiff2(item.ntime)}}</view>
					</view>
					<view class="margin-top-sm text-gray text-center padding-tb">
						<text class="text-xl text-black margin-bottom-sm text-bold" style="display: inline-block;">{{item.ntitle}}</text>
						<br>
						<text>{{item.ntext}}!</text>
					</view>
					<view class="solids-top new_hr" style="margin-top: 24rpx;"></view>
					<view style="margin-top: 24rpx; padding-top:24rpx;">立即查看 <text class="iconfont icon-jiantouarrow487 text-gray" style="font-size: 32rpx;margin-top: -14rpx;float: right;"></text></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				msgData:{},
				paramas:{
					limit: 15,
					pageno: 1,
					codex: {}
				},
				icon:{},
			}
		},
		onLoad(option){
			let aid= option.aid;
			this.icon.icons=option.icons;
			this.icon.icolor=option.icolor;
			let usersid= uni.getStorageSync('users').uid;
			this.news(aid,usersid)
			
		},
		methods: {
			news(aid,userId){
				let codex = {
					"aid": aid,
					"uid": userId
				}
				this.paramas.codex = codex;
				uni.showLoading({title:"加载中"});
				this.$request.postJson('/view/msgs/apage',this.paramas).then(res => {
					this.msgData=res.data.rows
					uni.hideLoading()
				})
			},
			naviageToPage(item) {
				 let i={id:item.id,aid:item.aid}
				uni.navigateTo({url: `/pages_mine/msgs/mview?item=${JSON.stringify(i)}`})
			}
		}
	}
</script>

<style>
.box{
	width: 100%;
	display: inline-block;
}
.title{
	letter-spacing:2rpx;
	font-size: 32rpx;
	display: inline-block;
}
.title_icon{
	font-size: 38rpx;
	border-radius: 99rpx;
	width: 44rpx;
	height: 44rpx;
	display: inline-block;
}
.title_con{
	vertical-align: super;
}
.title_icon:before{
	vertical-align: super;
}
.solids-top::after{
	border-top: 2rpx #ccc dashed;
}
</style>
